<template lang="">
 <div>
    <div>
      <div>完成：{{totalchecked}}个</div>
      <div>总共：{{total}}个</div>
    </div>
 </div>
</template>
<script>
export default {
  name: "Footer",
  props: ["list"],
  computed: {
    // 总共数量
    total() {
      return this.list.length;
    },
    // 完成数量
    totalchecked() {
      var result = this.list.reduce((total, item) => {
        if (item.checked) {
          return (total += 1);
        } else {
          return total;
        }
      }, 0);
      return result;
    }
  }
};
